﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Data;
using EXT;

namespace BanHangCshap.Class.gkhtdl63.DAL
{
    public abstract class ThuChi3DAL:clsBaseDAL
    {
        public bool ThuChi3_Them(Entities.ThuChi3 xlTC3)
        {
            string xlSPName = "sp_ThuChi3_Them";
            string[] xlSPPara = {   "@Ma"
                                    ,"@Ngay"
                                    ,"@Sotien"
                                    ,"@Ghichu"
                                    ,"@manoidungthuchi2"
                                    ,"@tendn"
                                    ,"@tendnLap"
                                 };

            object[] xlSPValu = {xlTC3.Ma
                                ,xlTC3.Ngay
                                ,xlTC3.Sotien
                                ,xlTC3.Ghichu
                                ,xlTC3.manoidungthuchi2
                                ,xlTC3.tendn
                                ,xlTC3.tendnLap
                                 };
            return base.Insert(xlSPName, xlSPPara, xlSPValu);
        }

        public bool ThuChi3_CapNhat(Entities.ThuChi3 xlTC3)
        {
            string xlSPName = "sp_ThuChi3_Capnhat";
            string[] xlSPPara = {   "@Id","@Ma"
                                    ,"@Ngay"
                                    ,"@Sotien"
                                    ,"@Ghichu"
                                    ,"@manoidungthuchi2"
                                    ,"@tendn"
                                    ,"@tendnLap"
                                 };

            object[] xlSPValu = {xlTC3.Id,xlTC3.Ma
                                ,xlTC3.Ngay
                                ,xlTC3.Sotien
                                ,xlTC3.Ghichu
                                ,xlTC3.manoidungthuchi2
                                ,xlTC3.tendn
                                ,xlTC3.tendnLap
                                 };
            return base.Update(xlSPName, xlSPPara, xlSPValu);
        }

        public bool Thuchi3_Xoa(long Id)
        {
            string xlSPName = "sp_ThuChi3_Xoa";
            string[] xlSPPara = { "@Id" };
            object[] xlSPValu = { Id };
            return base.Delete(xlSPName, xlSPPara, xlSPValu);
        }

        public DataTable ThuChi3_LayDanhsach(object Tungay, object Denngay)
        {
            string xlSPName = "sp_ThuChi3_LayDanhsach";
            string[] xlSPPara = { "@Tungay", "@Denngay" };
            object[] xlSPValu = { Tungay.ToDateTimeStart(), Denngay.ToDateTimeEnd() };
            return base.Select(xlSPName, xlSPPara, xlSPValu);
        }

        public DataTable ThuChi3_Taoma(string PMa)
        {
            string xlSPName = "sp_ThuChi3_Taoma";
            string[] xlSPPara = { "@PMa" };
            object[] xlSPValu = { PMa };
            return base.Select(xlSPName, xlSPPara, xlSPValu);
        }

        public bool ThuChi3_Xoa(object Id)
        {
            string xlSPName = "sp_ThuChi3_Xoa";
            string[] xlSPPara = { "@Id" };
            object[] xlSPValu = { Id };
            return base.Delete(xlSPName, xlSPPara, xlSPValu);
        }
    }
}
